<%@page import="java.util.UUID"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/pages/common/taglib.jsp" %>
<%
    String uuid = UUID.randomUUID().toString();
    request.setAttribute("uuid", uuid);
%>

<form id="examGridSearch" style="display: none;" class="box-body form-float"></form>
<form id="subjectGridSearch" style="display: none;" class="box-body form-float"></form>
<form id="optionGridSearch" style="display: none;" class="box-body form-float"></form>

<div class="row">
	<div class="col-md-6" >
		<div class="box box-primary">
			<div class="box-header with-border">
				<h3 class="box-title">
				</h3>
				<div class="box-tools pull-right" id="examGridToolBar">
				</div>
			</div>
			<div class="box-body">
				<table id="examGrid">
		   		</table>
			</div>
		</div>
	</div>
	<div class="col-md-6">
		<div class="box box-primary">
			<div class="box-header with-border">
				<h3 class="box-title">
					题目
				</h3>
				<div class="box-tools pull-right" id="subjectGridToolBar">
					
				</div>
			</div>
			<div class="box-body">
				<table id="subjectGrid"></table>
			</div>
		</div>
		<div class="box box-primary">
			<div class="box-header with-border">
				<h3 class="box-title">
					选项
				</h3>
				<div class="box-tools pull-right" id="optionGridToolBar">
					
				</div>
			</div>
			<div class="box-body">
				<table id="optionGrid"></table>
			</div>
		</div>
	</div>
</div>
<script>
$(function(){
	var uuid = '${uuid}';
	requirejs(['wiseMen/dataModel/QueryDefTreeTpl','wiseMen/dataModel/QueryDefTpl'],function(QueryDefTreeTpl,QueryDefTpl){
		var examGrid=new QueryDefTpl({
			code:"OA_EXAM",
			searchBarType:"dialog",
			searchDiv:"#examGridSearch",//查询定义栏
			toolBarDiv:"#examGridToolBar",//工具栏定义栏
			gridDiv:"#examGrid",//grid表格
			onSelect:function(row){
				subjectGrid.search({
					EXAMID:row.ID
				});
			}
		});
		
		var subjectGrid=new QueryDefTpl({
			code:"OA_EXAM_SUBJECT",
			searchBarType:"dialog",
			searchDiv:"#subjectGridSearch",//查询定义栏
			toolBarDiv:"#subjectGridToolBar",//工具栏定义栏
			gridDiv:"#subjectGrid",//grid表格
			onSelect:function(row){
				optionGrid.search({
					SUBJECTID:row.ID
				});
			},
			queryDatas:{
				EXAMID:"-1"
			}
		});

		var optionGrid=new QueryDefTpl({
			code:"OA_EXAM_OPTION",
			searchBarType:"dialog",
			searchDiv:"#optionGridSearch",//查询定义栏
			toolBarDiv:"#optionGridToolBar",//工具栏定义栏
			gridDiv:"#optionGrid",//grid表格
			onSelect:function(row){
				
			},
			queryDatas:{
				SUBJECTID:"-1"
			}
		});
	});
});
</script>